package org.dave.bracket.properties;

import java.io.IOException;
import java.io.InputStream;
import java.io.StringWriter;

public class PropsRunnable implements Runnable {
	
	InputStream in;
	Properties props;
	
	public PropsRunnable(InputStream in) {
		this.in = in;
	}

	public void run() {
		props = Properties.Factory.getInstance(in);
		OutputAdapter out = new OutputAdapter(props);
		StringWriter sw = new StringWriter();
		try {
			out.writeTo(sw);
			System.out.println(sw.toString());
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public Properties getProps() {
		return props;
	}

}
